﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1ExtensionMethods
{
    class ExtensionMethods
    {
        static void Main()
        {
            StringBuilder strb = new StringBuilder();
            StringBuilder sub = new StringBuilder();
            strb.Append("123456789");
            sub.Append(strb.Substring(2, 3));
            Console.WriteLine(strb);
            Console.WriteLine(sub);

            List<int> numbers = new List<int>();
            numbers.Add(5);
            numbers.Add(5);
            numbers.Add(20);
            numbers.Add(5);
            numbers.Add(12);
            int sumOfMembers = numbers.Sum();
            int product = numbers.Product();
            Console.WriteLine(sumOfMembers);
            Console.WriteLine(product);
            Console.WriteLine(numbers.MinElement());
            Console.WriteLine(numbers.MaxElement());
            Console.WriteLine(numbers.Average());
        }
    }
}
